var delButt = document.getElementById("textoOptDelete");
delButt.addEventListener("command",
function(e){
delDomainPref(document.getElementById("textoOptDomain").value, 'texto', function(){ var n = document.getElementById("texto.domain.list"); n.removeChild(n.childNodes[n.selectedIndex]); resetDomainPrefDialog(); });
return true; },
true);
// save button:
var saveButt = document.getElementById("textoOptSave");
saveButt.addEventListener("command",
function(e){
// what we are gonna do here is save this thing
// get the "domain" value
var domain = document.getElementById("textoOptDomain").value;
// build the json object
var jsonObj = {};
var opts = {"textoOptEditor":'value', "textoOptArgs":'value', "textoOptAuto":'value', "textoOptEnabled":'checked'};
for(var o in opts){ jsonObj[o] = document.getElementById(o)[opts[o]]; }
var jsonStr = JSON.stringify(jsonObj);
// save it all
addDomainPrefStr(
domain,
'texto',
jsonStr,
function(){
var list = document.getElementById('texto.domain.list');
function getDomainPrefStr(domain, extension, callback){
if(dbConn == null){ initDomainDb(); }
var jsonStr = "{}";
var stmt = dbConn.createStatement("SELECT * FROM domain_options WHERE extension = :extension AND :domain LIKE domain_options.domain||'%' ORDER BY domain_options.domain DESC");